const Mock = require('mockjs')

const data = Mock.mock({
  'items|30': [{
    id: '@id',
    title: '@sentence(1, 2)',
    'category|1-3': [{value: '@word(3,5)'}],
    bookshelfLocation: '@string()',
    count: '@integer()',
    body: '@sentence(1, 2)'
  }]
})

module.exports = [
  {
    url: '/vue-admin-template/table/list',
    type: 'get',
    response: config => {
      const items = data.items
      return {
        code: 20000,
        data: {
          total: items.length,
          items: items
        }
      }
    }
  }
]
